<?php

namespace App\Http\Requests\Api;

/**
 * 注册表单验证
 * Class RegisterRequest
 * @package App\Http\Requests\Api
 */
class RegisterRequest extends BaseRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'name' => ['required', 'min:2'],
            'email' => ['required', 'email'],
            'password' => ['required', 'min:8']
        ];
    }

    // \resources\lang\zh\validation.php 中的 attributes 中已经有了，这里就不需要了。
    /*public function attributes()
    {
        return [
            'name' => '用户名',
            'email' => '电子邮箱',
            'password' => '密码'
        ];
    }*/
}
